﻿using Abp.Application.Services;
using Abp.Application.Services.Dto;
using Laboratory.Users.Dto;
using System;
using System.Collections.Generic;

namespace Laboratory.Users
{
    public interface IUserService : IApplicationService
    {

        // 角色操作

        /// <summary>
        /// 创建角色
        /// </summary>
        /// <param name="name">角色名称</param>
        /// <param name="sort">排序</param>
        void CreateRole(string name, int sort);

        /// <summary>
        /// 修改角色
        /// </summary>
        /// <param name="id">角色Id</param>
        /// <param name="name">角色名称</param>
        /// <param name="sort">排序</param>
        void UpdateRole(Guid id, string name, int sort);

        /// <summary>
        /// 查询角色集合
        /// </summary>
        /// <returns></returns>
        IEnumerable<RoleDto> GetRoles();

        /// <summary>
        /// 查询角色
        /// </summary>
        /// <param name="id">角色Id</param>
        /// <returns></returns>
        RoleDto GetRole(Guid id);


        // 菜单操作

        /// <summary>
        /// 创建菜单
        /// </summary>
        /// <param name="displayName">显示名称</param>
        /// <param name="icon">图标</param>
        /// <param name="order">排序</param>
        /// <param name="url">链接</param>
        /// <param name="parentId">父级Id</param>
        void CreateMenu(string displayName, string icon, int order, string url, Guid? parentId);

        /// <summary>
        /// 修改菜单
        /// </summary>
        /// <param name="id">菜单Id</param>
        /// <param name="displayName">显示名称</param>
        /// <param name="icon">图标</param>
        /// <param name="order">排序</param>
        /// <param name="url">链接</param>
        /// <param name="parentId">父级Id</param>
        void UpdateMenu(Guid id, string displayName, string icon, int order, string url, Guid? parentId);

        /// <summary>
        /// 删除菜单
        /// </summary>
        /// <param name="id">菜单Id</param>
        void DeleteMenu(Guid id);

        /// <summary>
        /// 分页查询菜单
        /// </summary>
        /// <param name="keyword">关键字</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageCount">页大小</param>
        /// <returns></returns>
        PagedResultDto<MenuDto> GetMenus(string keyword, int pageIndex, int pageCount);

        /// <summary>
        /// 查询层级菜单集
        /// </summary>
        /// <returns></returns>
        IEnumerable<MenuItemDto> GetMenuItems();

        /// <summary>
        /// 查询菜单
        /// </summary>
        /// <param name="id">菜单id</param>
        /// <returns></returns>
        MenuDto GetMenu(Guid id);


        // 账号操作

        /// <summary>
        /// 创建账号
        /// </summary>
        /// <param name="name">昵称</param>
        /// <param name="loginId">登录Id</param>
        /// <param name="password">密码</param>
        /// <param name="remark">备注</param>
        /// <param name="roleId">角色Id</param>
        /// <param name="isEnabled">是否启用</param>
        void CreateAccount(string name, string loginId, string password, string remark, Guid roleId, bool isEnabled);

        /// <summary>
        /// 修改账号
        /// </summary>
        /// <param name="id">账号Id</param>
        /// <param name="name">昵称</param>
        /// <param name="loginId">登录Id</param>
        /// <param name="password">密码</param>
        /// <param name="remark">备注</param>
        /// <param name="roleId">角色Id</param>
        /// <param name="isEnabled">是否启用</param>
        void UpdateAccount(Guid id, string name, string loginId, string password, string remark, Guid roleId, bool isEnabled);

        /// <summary>
        /// 分页查询账号
        /// </summary>
        /// <param name="keyword">关键字</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageCount">页大小</param>
        /// <returns></returns>
        PagedResultDto<AccountDto> GetAccounts(string keyword, int pageIndex, int pageCount);

        /// <summary>
        /// 查询账号
        /// </summary>
        /// <param name="id">账号id</param>
        /// <returns></returns>
        AccountDto GetAccount(Guid id);



    }
}
